<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<meta name="format-detection" content="telephone=no">
	<title>{$site_seo_title}</title>
	<base id="headbase" href="__TMPL__/seatsel/" />
	{include file="./tplnew/public/css_weui.html" /}
	<link rel="stylesheet" href="css/style.css?{$suffix}" />
	<link rel="stylesheet" type="text/css" href="__STATIC__/Zz22zzUI/addon/niftymodal/css/niftymodal.css">
</head>
<body class="body-fixed-bottom" ontouchstart>

<!--主体-->
<header class="wenew-header wenew-header-green">
	<a href="javascript:history.back(-1);" class="wenew-header-icon-back"><i class="iconfontzz icon-fanhuijiantou w15"></i>返回</a>
	<div class="wenew-header-title">{$site_seo_title}</div>
</header>

<div class="address-list-wrap">
	<div class="weui-cells mt0 J_list">
		{volist name="userVoucherList" id="vo"}
			<div class="weui-media-box weui-media-box_text address-media-box J_choose" data-id="{$vo['id']}">
				<div class="weui-media-box__bd">
					<h4 class="weui-media-box__title">{$vo['voucher_name']}</h4>
					<div class="weui-media-box__desc">
						金额：{$vo['real_amount']}
					</div>
					<div class="weui-media-box__desc">
						过期时间：{$vo['expire_time_show']}
					</div>
				</div>
			</div>
		{/volist}
	</div>
</div>

<?php
$layerStyle = 2;
?>
{include file="./tplnew/public/script_weui.html" /}

<script type="text/javascript">
var initMode = "{$initMode}";
var initPid = "{$initPid}";
var initSpecId = "{$initSpecId}";
var idStr = "{$idStr}";
var url_doVerify = "{:url('seatsel/orderVoucher/doVerify')}"; //选择抵扣券后验证
$('.J_list').on('click', '.J_choose', function(e){
	e.preventDefault();
	var id = $(this).data('id');
	var param = {
		id: id,
		initMode: initMode,
		initPid: initPid,
		initSpecId: initSpecId,
		idStr: idStr,
	};
	$.post(url_doVerify, param, function(ret){
		if(ret.code == 1){
    		window.location.href = "{:url('seatsel/orderPrepair/index')}"+'?initMode='+initMode+'&initPid='+initPid+'&initSpecId='+initSpecId+'&idStr='+idStr+'&userVoucherId='+id;
		}else if(ret.code == 0){
			Wei.Util.wapTipNew({msg: ret.msg, icon: 2, data: ret.data, url: ret.url});
		}
	}, "json");
});
</script>

</body>
</html>